<script lang="ts" setup>
import {computed} from 'vue'

const props = defineProps({
  prefix: {
    type: String,
    default: 'icon'
  },
  name: {
    type: String,
    required: true
  },
  color: {
    type: String,
    default: '#000000'
  },
  size: {
    type: String,
    default: '1em'
  }
})
const symbolId = computed(() => `#${props.prefix}-${props.name}`)
</script>

<template>
  <svg
      :height="props.size"
      :width="props.size"
      aria-hidden="true"
      class="svg-icon"
  >
    <!--suppress HtmlUnknownAttribute -->
    <use :fill="props.color" :xlink:href="symbolId"/>
  </svg>
</template>